package com.gym.client;

import com.gym.pojo.Employee;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "gateway",path = "/staffdb-provider",contextId = "staffdb-provider")
public interface StaffdbClient {
    @RequestMapping("/login")
    public Employee login(@RequestParam(name = "account")String account, @RequestParam(name = "password")String password);
    @RequestMapping("/selaccount")
    public List<Employee> selaccount(@RequestParam(name = "account")String account);
    @RequestMapping("/selemp")
    public Map<String,Object> select(@RequestParam String empname, @RequestParam int page, @RequestParam int limit);
    @RequestMapping("/insert")
    public boolean insert(@SpringQueryMap Employee em);
    @RequestMapping("/update")
    public boolean update(@SpringQueryMap Employee em);
    @RequestMapping("/delete")
    public boolean delete(@RequestParam(name = "empId")int empId);
    @RequestMapping("/selempid")
    public Employee selempid(@RequestParam(name = "empId") int empId);
    @RequestMapping("/updatepwd")
    public boolean updatepwd(@SpringQueryMap Employee em);
    @RequestMapping("/selectpwd")
    public Employee selectpwd(@RequestParam(name = "account") String account ,@RequestParam(name = "password") String password);
}
